cmake_minimum_required(VERSION 3.11)

set(TOP_DIR ${CMAKE_SOURCE_DIR}/../../../../../../)
set(DEV_TOP_DIR ${TOP_DIR})

set(CMAKE_VERBOSE_MAKEFILE on)

add_definitions(-DNDK_DEBUG=1)

unset(PLAYER_LITE CACHE)
option(PLAYER_LITE "android app uses lite player interface" ON)
message(STATUS "Android: PLAYER_LITE is ${PLAYER_LITE}")

message(STATUS "TOP DIR: ${TOP_DIR}")
set(RES_RAW_DIR ${TOP_DIR}/demo/android/app/src/main/res/raw/)
file(MAKE_DIRECTORY ${RES_RAW_DIR})
file(COPY ${TOP_DIR}/resource/dream_it_possible.mp3 DESTINATION ${RES_RAW_DIR})

include_directories(
    ${TOP_DIR}/plugins
    ${TOP_DIR}/adapter
    ${TOP_DIR}/adapter/android
    ${TOP_DIR}/3rdparty/ohos
    ${TOP_DIR}/3rdparty/ffmpeg/include
    ${TOP_DIR}/3rdparty/SDL2.0/include
    ${TOP_DIR}/3rdparty/minimp3
    ${TOP_DIR}/3rdparty/ohos/engine_intf
    ${TOP_DIR}/3rdparty/ohos/audio_standard/audiocapturer/include
)

set(ffmpeg_lib_path ${TOP_DIR}/3rdparty/ffmpeg/android/lib/arm64-v8a)
set(sdl_lib_path ${TOP_DIR}/3rdparty/SDL2.0/android/lib/arm64-v8a)

link_directories(
        ${ffmpeg_lib_path}
        ${sdl_lib_path}
)

file(GLOB_RECURSE 3RDPARTY_SRCS
        ${TOP_DIR}/3rdparty/ohos/*.cpp
        )

#include(${TOP_DIR}/histreamer.cmake)
#set(PLAYER_INTERFACE_DIR ${histreamer_SOURCE_DIR}/interface)
set(PLAYER_INTERFACE_DIR ${TOP_DIR}/histreamer/interface)

add_subdirectory(${TOP_DIR}/histreamer histreamer.out)
add_subdirectory(${TOP_DIR}/plugins/sink/android audiotrack_sink.out)
add_subdirectory(jni)
add_subdirectory(jni_helper)
